<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'inventoryassembly-form',
	'enableAjaxValidation'=>true,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'partno'); ?>
		<?php echo $form->textField($model,'partno',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'partno'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'counter'); ?>
		<?php echo $form->textField($model,'counter',array('size'=>3,'maxlength'=>3)); ?>
		<?php echo $form->error($model,'counter'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'subpartno'); ?>
		<?php echo $form->textField($model,'subpartno',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'subpartno'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'qty'); ?>
		<?php echo $form->textField($model,'qty'); ?>
		<?php echo $form->error($model,'qty'); ?>
	</div>

	<div class="row_buttons">
            <?php if($model->isNewRecord):?>
                <?php echo CHtml::ajaxSubmitButton('Create','index.php?r=inventoryassembly/create&partno='.$model->partno,array(
                    'success'=>'function(data){
                                    if(data==1){
                                        $.fancybox.close()
                                    }
                                }'
                )); ?>
            <?php else:?>
                <?php echo CHtml::ajaxSubmitButton('Update','index.php?r=inventoryassembly/update&partno='.$model->partno,array(
                    'success'=>'function(data){
                                    if(data==1){
                                        $.fancybox.close()
                                    }
                                }'
                )); ?>
            <?php endif?>
            
	
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->